package org.feidao.chapter71.service;

import com.feidao.service.User;
import com.feidao.service.UserException;
import com.feidao.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.apache.thrift.TException;

import java.util.ArrayList;
import java.util.List;

@Slf4j
public class UserServiceImpl implements UserService.Iface {
    @Override
    public String ping() throws UserException, TException {
        return "pong";
    }

    @Override
    public List<User> getUserList() throws TException {
        List<User> userList = new ArrayList<>();

        User user1 = new User();
        user1.setUserName("曹操");
        userList.add(user1);

        User user2 = new User();
        user2.setUserName("刘备");
        userList.add(user2);

        User user3 = new User();
        user3.setUserName("孙权");
        userList.add(user3);

        return userList;
    }
}
